package com.kikikeji.weizhuo;

import android.app.Application;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.test.ApplicationTestCase;

import com.kikikeji.weizhuo.activity.launchersetting.LauncherSettingsActivity;
import com.kikikeji.weizhuo.compat.LauncherActivityInfoCompatV16;
import com.kikikeji.weizhuo.compat.UserHandleCompat;
import com.kikikeji.weizhuo.data.AppInfo;

import java.util.List;

/**
 * Created by zhang on 2016/12/3.
 */

public class launcherSettingTest extends ApplicationTestCase<Application> {

    private PackageManager mPackageManager;

    public launcherSettingTest() {
        super(Application.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        mPackageManager = getContext().getPackageManager();

    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }
    public void testGetLauncherSettingActivity() {
        final Intent intent = new Intent(mContext, LauncherSettingsActivity.class);

        List<ResolveInfo> infos = mPackageManager.queryIntentActivities(intent, 0);
        LauncherActivityInfoCompatV16 compatV16 = new LauncherActivityInfoCompatV16(mContext, infos.get(0));
        LauncherAppState instance = LauncherAppState.getInstance();
        IconCache iconCache = instance.getIconCache();
        AppInfo appInfo = new AppInfo(mContext, compatV16, UserHandleCompat.myUserHandle(), iconCache);
        assertEquals(true, true);
    }
}
